<?php

namespace api\blog\route;

use api\blog\middleware\ApiCheckToken;
use api\blog\middleware\Upload;
use think\facade\Route;

////注册路由
//Route::post('register','api/blog/user/register');
////登录
//Route::post('login','api/blog/user/login');
////验证码
//Route::post('code','api/blog/user/sendCode');

//用户相关的路由
Route::group('admin',function(){

    //用户信息查询
    Route::post('list','api/blog/upload/list');
    //用户信息查询上传图片
    Route::post('image','api/blog/upload/uploadFile');
    //用户信息增加
    Route::post('add','api/blog/upload/adminAdd');
    //充值金额
    Route::post('money','api/blog/money/money');
})->middleware(ApiCheckToken::class);//使用中间件;
//注册路由
Route::post('register','api/blog/user/register');

//验证码
Route::post('code','api/blog/user/sendCode');
//登录
Route::post('login','api/blog/user/login');

//首页
Route::group('index',function (){
    //轮播图
    Route::post('banner','api/blog/banner/getBannerList');
    //分类
    Route::post('classify','api/blog/classify/getClassifyList');
});

//收货信息
Route::group('address',function (){
    //收货信息
    Route::post('address','api/blog/DeliveryAddress/getAddressList');
    //添加收货信息
    Route::post('add','api/blog/DeliveryAddress/addAddress');
    //编辑收货信息
    Route::post('edit','api/blog/DeliveryAddress/editAddress');
    //编辑收货信息
    Route::post('del','api/blog/DeliveryAddress/delAddress');
})->middleware(ApiCheckToken::class);//使用中间件;

//商品
Route::group('order',function (){
    //商品订单支付购买
    Route::post('order','api/blog/Order/order');
    //订单商品支付信息
    Route::post('pay','api/blog/pay/walletPay');
    //获取商品信息
    Route::post('goodslist','api/blog/Order/getGoodsList');
    //获取商品详情
    Route::post('info','api/blog/Order/info');
    //查询物流信息
    Route::post('wuliu','api/blog/Wuliu/wuliu');
})->middleware(ApiCheckToken::class);//使用中间件;